package com.atguigu.gulimall.product.contrlller;

import com.atguigu.gulimall.product.model.Category;
import com.atguigu.gulimall.product.service.CategoryService;
import com.xunqi.common.utils.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
public class CateGoryController {

    @Autowired
    CategoryService categoryService;


    @GetMapping("/find/allcate")
    public R findAllCateChild(){
        List<Category> categoryList = categoryService.listWithTree();
        return R.ok().put("list",categoryList);
    }

}
